package com.CST.service.impl.cb;

import com.CST.common.api.ResultObject;
import com.CST.dto.cb.DateDTO;
import com.CST.mapper.cst.cb.DataAccountingMapper;
import com.CST.service.cb.IDataAccountingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DataAccountingServiceImpl implements IDataAccountingService {
    
    @Autowired
    private DataAccountingMapper dataAccountingMapper;
    
    @Override
    public ResultObject directAmortization(DateDTO dateDTO) {
        // 获取行政类科室的总成本
        Double sumAmount = dataAccountingMapper.getXzSumAmount(dateDTO);
        // 获取临床类人数
        Integer clinicalNum = dataAccountingMapper.getDeptNumByDeptTypeId("01");
        // 获取医技类人数
        Integer medicalTechnologyNum = dataAccountingMapper.getDeptNumByDeptTypeId("02");
        // 获取医辅类人数
        Integer medicalAssistanceNum = dataAccountingMapper.getDeptNumByDeptTypeId("03");
        // 总人数
        Integer allNum = clinicalNum + medicalAssistanceNum + medicalTechnologyNum;
        // 计算临床职工人数占比
        return ResultObject.successReturn(allNum);
    }
}
